package com.zhos.demo.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhos.demo.model.Users;
import com.zhos.demo.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-01-03
 */
@RestController
@RequestMapping("/users")
public class UsersController {

    @Autowired
    private IUsersService iUsersService;

    @GetMapping("/all")
    public List<Users> findAll() {
        return iUsersService.findAllUser();
    }

    @GetMapping("/page")
    public Page findPage() {
        return iUsersService.findPage();
    }
}
